package com.itheima.web.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.github.pagehelper.PageInfo;
import com.itheima.domain.company.Company;
import com.itheima.service.company.CompanyService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.UUID;

@Controller
public class CompanyController {

    @Reference
    private CompanyService companyService;

    @RequestMapping("/apply")
    public @ResponseBody
    String saveOrUpdate(Company company) {
        try {
            companyService.save(company); //保存
            return "1";
        } catch (Exception e) {
            return "0";
        }
        // return "redirect:/company/list.do"; //重定向到查询所有的controller
    }


}
